/*
 * video.h
 *
 * Copyright (C) 2001 Matt Ownby
 *
 * This file is part of DAPHNE, a laserdisc arcade game emulator
 *
 * DAPHNE is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * DAPHNE is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

// by Matt Ownby
// Part of the DAPHNE emulator

#ifndef BITMAP_H
#define BITMAP_H

#include <stdint.h>

#include <SDL.h>

#define LED_RANGE 17 //16 is normal, the 17th is for the 'A' in SAE

#define OVERLAY_LED_WIDTH 8
#define OVERLAY_LED_HEIGHT 13

#define OVERLAY_LDP1450_WIDTH 16                //width of each LDP1450 overlay character
#define OVERLAY_LDP1450_HEIGHT 16               //height of each LDP1450 overlay character
#define OVERLAY_LDP1450_CHARACTER_SPACING 15    //spacing between LDP1450 overlay characters
#define OVERLAY_LDP1450_LINE_SPACING 16         //spacing between LDP1450 overlay lines

enum { B_DL_PLAYER1, B_DL_PLAYER2, B_DL_LIVES, B_DL_CREDITS, B_DAPHNE_SAVEME, B_GAMENOWOOK, B_OVERLAY_LEDS, B_OVERLAY_LDP1450, B_EMPTY }; // bitmaps
enum { FONT_SMALL, FONT_BIG };	// font enumeration, dependent on which order font .bmp's are loaded in

// dimensions of small font
#define FONT_SMALL_W 6
#define FONT_SMALL_H 13

////////////////////////////////////////////////////////////////////////////////////////////////////////

bool init_display();

void shutdown_display();

// flips the video buffers (if in double buffering mode)
void vid_flip();

// blanks the back video buffer (makes it black)
void vid_blank();

// blits an SDL Surface to the back buffer
void vid_blit(SDL_Surface *srf, int x, int y);

void display_repaint();
bool load_bmps();
bool draw_led(int, int, int);
void draw_overlay_leds(unsigned int led_values[], int num_values, int x, int y, SDL_Surface *overlay);

void draw_singleline_LDP1450(char *LDP1450_String, int start_x, int y, SDL_Surface *overlay);

bool draw_othergfx(int which, int x, int y, bool bSendToScreenBlitter = true);
void free_bmps();

// RJS REMOVE - this routine doesn't exist
//void draw_rectangle(short x, short y, unsigned short w, unsigned short h, unsigned char red, unsigned char green, unsigned char blue);

SDL_Surface *get_screen();
SDL_Surface *get_screen_blitter();

void set_sboverlay_characterset(int value);
uint16_t get_video_width();
void set_video_width(uint16_t);
uint16_t get_video_height();
void set_video_height(uint16_t);
void draw_string(const char*, int, int, SDL_Surface*);

void set_force_aspect_ratio(bool bEnabled);

bool get_force_aspect_ratio();

#endif
